'''
Created on Dec 22, 2010

@author: hugosenari
'''
class ServiceOauth(Service):
    """oauth threeleegged interface"""

    def __init__(self):
        self.authUrl = None
        self.token = None
        self.accessToken = None
        super(ServiceOauth, self).__init__(Service.AUTH_WITH_OAUTH)

    def getAuthUrl(self):
        """Url to user get token from service server"""
        return self.authUrl

    def setToken(self, token):
        """Input user token provided by service server"""
        self.token = token

    def setAccessToken(self, token):
        """Input saved access token"""
        self.accessToken = token

    def getAccessToken(self, token = None):
        if not(token == None):
            self.setToken(token)
        return self.accessToken
